import util.GradeDBUtil;
import org.junit.Test;
import pojo.Grade;

public class GradeTest {


    //添加班级
   @Test
   public void addGrade(){
       GradeDBUtil gradeDBUtil=new GradeDBUtil();
       Grade grade=new Grade(307,"三年六班","java大数据");
       gradeDBUtil.addGrade(grade);
   }
   //删除班级
    @Test
    public void deleteGrade(){
       GradeDBUtil gradeDBUtil=new GradeDBUtil();
       gradeDBUtil.deleteGradeByGno(307);

    }
    //更新班级信息
    @Test
    public void updateGrade(){
       GradeDBUtil gradeDBUtil=new GradeDBUtil();
        Grade grade=new Grade(306,"三年六班","java大数据");
       gradeDBUtil.updateGrade(grade);
    }

    //查询班级信息
    @Test
    public void testGetGradeByGno() {
        GradeDBUtil gradeDBUtil = new GradeDBUtil();
        //查询
        Grade gradeByGno = gradeDBUtil.getGradeByGno(301);
        System.out.println("grade = " + gradeByGno);
    }
}
